Repository navigation
refactor: settle the hot option names before release - #2476
alexander-akait wants to merge 2 commits into
Conversation
Remove `hot.server` (use `attach` or `handleUpgrade`), `hot.client.token` (filled in from `hot.token`) and the six legacy `hot.client` keys, which the entry query still reads. Rename `hot.client.path` to `hot.client.url` (the query reads both) and `hot.client.urlPrefix` to `pageParamPrefix`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UjuMAuk9o6UazjHzcAQCTA
|
| Name | Type |
|---|---|
| webpack-dev-middleware | Minor |
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughThe client endpoint option changes from Priority: ➖ Normal Merge Risk: 🔵 Low · up to Mergeable with a documentation correction: the upgrade guidance should distinguish passing a server to Pre-merge checks |
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
d0bf14c9-bbcf-4839-b593-753325371ebf
📒 Files selected for processing (16)
.changeset/hot-client-apply-and-connect.md.changeset/hot-client-options.mdREADME.mdclient-src/index.jssrc/hot.jssrc/options.check.jssrc/options.jsonsrc/utils.jstest/__snapshots__/validation-options.test.js.snap.webpack5test/e2e/client.test.jstest/e2e/inject.test.jstest/e2e/live-reload.test.jstest/e2e/transport.test.jstest/inject-client.test.jstypes/client/index.d.tstypes/hot.d.ts
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
| * options.hot.transport should be one of these: | ||
| "sse" | "ws" | function | ||
| -> How events reach the clients: \`sse\`, \`ws\` (needs the optional \`ws\` dependency and an HTTP server to answer upgrades on, given as \`server\` or through the middleware's \`attach\` method), or a function building a transport of your own. | ||
| -> How events reach the clients: \`sse\`, \`ws\` (needs the optional \`ws\` dependency and an HTTP server to answer upgrades on, handed over through the middleware's \`attach\` or \`handleUpgrade\` method), or a function building a transport of your own. |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
#!/bin/bash
set -eu
rg -n -C 2 'HTTP server to answer upgrades on|handleUpgrade' src/options.jsonRepository: webpack/webpack-dev-middleware
Length of output: 558
🏁 Script executed:
set -eu
printf '%s\n' '--- candidate declarations and references ---'
rg -n -F --glob '*.{js,json,ts,d.ts}' -- 'handleUpgrade' src lib types test || test "$?" -eq 1
rg -n -F --glob '*.{js,json,ts,d.ts}' -- 'attach' src lib types test || test "$?" -eq 1
printf '%s\n' '--- source tree candidates ---'
rg --files src lib types 2>/dev/null | head -80Repository: webpack/webpack-dev-middleware
Length of output: 41154
🏁 Script executed:
set -eu
rg -n -F --glob '!node_modules/**' --glob '!src/options.check.js' -- 'attach(' .
rg -n -F --glob '!node_modules/**' --glob '!src/options.check.js' -- 'attach' types src README.md test 2>/dev/null || test "$?" -eq 1Repository: webpack/webpack-dev-middleware
Length of output: 11347
Correct the WebSocket upgrade guidance.
The schema wording implies that handleUpgrade receives the HTTP server. Describe attach(server) and handleUpgrade(req, socket, head) separately, then regenerate both validation snapshots.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2476 +/- ##
==========================================
+ Coverage 96.55% 96.66% +0.10%
==========================================
Files 24 24
Lines 2642 2637 -5
==========================================
- Hits 2551 2549 -2
+ Misses 91 88 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Validation cases for `hot.client` (none existed) and for each removed or
renamed name, and e2e cases for `setOptionsAndConnect({ path })` and for
`url` winning over `path` on the query.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UjuMAuk9o6UazjHzcAQCTA
The last pass over the middleware's options before 8.4.0. Everything changed here was added after 8.3.0, so nothing released breaks.
Removed
hot.serverattach(server)orhandleUpgrade(req, socket, head), which already did the same thinghot.client.tokenhot.token, the one place a token is sethot.client.hot,liveReload,reload,autoConnect,reconnect,timeouthot.client.applyandhot.client.connect. The entry query still reads the six old names (with the warning as before) until the next major release, since 8.3.0 entries and webpack-dev-server's hand-written ones use themRenamed
hot.client.path→hot.client.url: it takes a url or its parts, not only a path, and no longer reads like a secondhot.path. The query reads bothurlandpath, sincepathshipped there in 8.3.0.hot.client.urlPrefix→hot.client.pageParamPrefix: it names the page-url parameter (?<prefix>-apply=), not a prefix of any url.hot.client.transportandcache.immutablekeep their names.Also
hot.transportdescription no longer mentionsserver.hot.clientand the query to one set of names now lists the query-only names (path,token, the six legacy ones) explicitly.Tests
writeToDiskEACCES, which root never gets); e2e 229 of 229; lint clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01UjuMAuk9o6UazjHzcAQCTA
Generated by Claude Code
Summary by CodeRabbit
hot.client.urlinstead ofhot.client.path, and usepageParamPrefixinstead ofurlPrefixto rename the per-page query parameter.urlnow takes precedence overpath.hot.ws; provide HTTP server upgrades throughattachorhandleUpgrade. Thehot.serveroption is no longer supported.token,hot,liveReload,reload,reconnect,timeout, andautoConnect.